/**
 * This class will implement the Rates change request.
 * @author Gil Levinson
 * @author Boris Fradlis
 * @author Yogev Levi
 * @author Hila Porat
 * 
 */

package vcpClasses;
import java.io.Serializable;

//Start of RateSettingRequest ******************************************************************

public class RateSettingRequest extends Notification{
	
	//Class variable **************************************************************************
	
	private Rates ratesToSet;
	
	// Constructors ****************************************************************************
	
	
	/**
	 * Empty constructor 
	 */
	
	public RateSettingRequest(){}
	
	/**
	 * Constructor using the following fields: 
	 * @param type the type of notification
	 * @param content the content of notification
	 * @param rates the new rates object
	 * @param sender the sender of this request
	 */
	
	public RateSettingRequest(String type, Serializable content, Rates rates, String sender){
		this.setType(type);
		this.setContent(content);
		this.setRatesToSet(rates);
		this.setSender(sender);
	}
	
	/**
	 * Construct using notification object
	 * @param notification the notification object
	 */
	
	public RateSettingRequest(Notification notification){
		super(notification);
		this.setRatesToSet(null);
	}
	
	/**
	 * Constructor using the following fields:
	 * @param notification the notification to set 
	 * @param rates the new rates to set
	 */
	
	public RateSettingRequest(Notification notification,Rates rates){
		super(notification);
		this.setRatesToSet(rates);
	}
	
	/**
	 * Constructor using the following fields:
	 * @param notification the notification to set 
	 * @param occ the new occasional rate
	 * @param adv the new In advance rate
	 */
	
	public RateSettingRequest(Notification notification,float occ, float adv, float norm, float full){
		super(notification);
		this.ratesToSet.setOccasional(occ);
		this.ratesToSet.setAdvance(adv);
		this.ratesToSet.setNormalSubHours(norm);
		this.ratesToSet.setFullSubHours(full);
	}
	
	// Instance methods ***************************************************************
	
	/**
	 * This method will receive the new rates and will build the request
	 * @param occ the new occasional rate
	 * @param adv the new In advance rate
	 */
	
	public void setRatesToSet(float occ, float adv, float norm, float full) {
		Rates rate = new Rates(occ,adv,norm,full);
		this.setRatesToSet(rate);
	}

	// Getters and Setters ************************************************************
	
	/**
	 * @return the ratesToSet
	 */
	public Rates getRatesToSet() {
		return ratesToSet;
	}

	/**
	 * @param ratesToSet the ratesToSet to set
	 */
	public void setRatesToSet(Rates ratesToSet) {
		this.ratesToSet = ratesToSet;
	}
	
	
}
